<template>
  <div class="wrap">
    <h3>我的收藏</h3>
    <ul class="clearfix" v-show="show">
      <li v-for="item in arr" >
        <img :src="item.url"/>
        <h4>{{item.tit}}</h4>
        <h5>{{item.tit1}}</h5>
        <div class="bot clearfix">
          <span class="span1">￥{{item.newprice}}</span>
          <s class="span2">¥{{item.price}}</s>
          <img :src="item.url2"/>
        </div>
        <button :class="item.bol?'btn1':'btn2'">{{item.tit2}}</button>
      </li>
    </ul>
    <p class="pp" v-show="show1">暂无数据,请登录</p>
  </div>
</template>

<script>
    export default {
        name: "Collect",
      data(){
          return{
            show:true,
            show1:false,
            arr:[
              {'url':'../../../static/zwf/mine/tao.png',tit:'新西兰佳沛黄金奇异果',tit1:'花蜜般的甘甜百吃不厌',bol:true,tit2:'已失效',newprice:'28.80',price:'40.00','url2':'../../../static/zwf/mine/gouwuche.png'},
              {'url':'../../../static/zwf/mine/tao.png',tit:'新西兰佳沛黄金奇异果',tit1:'花蜜般的甘甜百吃不厌',bol:false,tit2:'取消收藏',newprice:'28.80',price:'40.00','url2':'../../../static/zwf/mine/gouwuche.png'},
              {'url':'../../../static/zwf/mine/tao.png',tit:'新西兰佳沛黄金奇异果',tit1:'花蜜般的甘甜百吃不厌',bol:false,tit2:'取消收藏',newprice:'28.80',price:'40.00','url2':'../../../static/zwf/mine/gouwuche.png'},
            ]
          }
      },
      mounted(){
          if(this.arr.tit2=='取消收藏'){
            this.bol=false;
          }

        if(this.$store.state.phone==''){
          this.show=false;
          this.show1=true;
        }else{
          this.show=true;
          this.show1=false;
        }
      }
    }
</script>

<style scoped>
  .wrap{
    width: 1083px;
    height: 623px;
    border: 1px solid #e7e7e7;
  }
  .wrap h3{
    width: 1063px;
    height: 56px;
    line-height: 56px;
    padding-left: 20px;
    font-size: 18px;
    color: #212121;
    border-bottom: 1px solid #e7e7e7;
  }

  ul{
    width: 1083px;
    padding-top: 40px;
  }
  li{
    float: left;
    width: 264px;
    height: 440px;
    margin-left: 40px;
    padding: 20px;
    border: 1px solid #e9e9e9;
  }
  li>img{
    width: 255px;
    height: 240px;
  }
  h4{
    font-size: 18px;
    color: #707070;
    margin-bottom: 15px;
    margin-top: 15px;
  }
  h5{
    font-size: 14px;
    color: #949494;
    margin-bottom: 20px;
  }
  .bot{
    width: 100%;
  }
  .bot .span1{
    font-size: 20px;
    color: #ffc0c0;
  }
  .bot .span2{
    font-size: 14px;
    color: #949494;
    margin-left: 18px;
  }

  .bot img{
    float: right;
    cursor: pointer;
  }

  .btn1{
    width: 150px;
    height: 36px;
    border-radius: 36px;
    background: #999999;
    font-size: 16px;
    color: #fff;
    margin-top: 20px;
    margin-left: 55px;
  }
  .btn2{
    width: 150px;
    height: 36px;
    border-radius: 36px;
    background: #4b943d;
    font-size: 16px;
    color: #fff;
    margin-top: 20px;
    margin-left: 55px;
  }

  .pp{
    width: 1083px;
    height: 46px;
    line-height: 46px;
    border-bottom: 1px solid #e9e9e9;
    text-align: center;
  }
</style>
